﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for DanhGia
/// </summary>
public class EDanhGia
{
    
    private string maSP;
    private string tieuDe;
    private string noiDung;
    private string nguoigoi;
    private DateTime thoiGian;
    private bool trangThai;
    private int diem;
   
    public EDanhGia()
    { }
    public EDanhGia(string maSP, string tieuDe, string noiDung, string nguoigoi, DateTime thoiGian, bool trangThai, int diem)
    {
       
        this.maSP = maSP;
        this.tieuDe = tieuDe;
        this.noiDung = noiDung;
        this.nguoigoi = nguoigoi;
        this.thoiGian = thoiGian;
        this.trangThai = trangThai;
        this.diem = diem;
       
    }
   
    public string MaSP
    {
        get { return this.maSP; }
        set
        {
            if (value == null)
                throw new Exception("maSP not allow nullvalue.");
            this.maSP = value;
        }
    }
    public string TieuDe
    {
        get { return this.tieuDe; }
        set { this.tieuDe = value; }
    }
    public string NoiDung
    {
        get { return this.noiDung; }
        set { this.noiDung = value; }
    }
    public string Nguoigoi
    {
        get { return this.nguoigoi; }
        set { this.nguoigoi = value; }
    }
    public DateTime ThoiGian
    {
        get { return this.thoiGian; }
        set { this.thoiGian = value; }
    }
    public bool TrangThai
    {
        get { return trangThai; }
        set { trangThai = value; }
    }
    public int Diem
    {
        get { return this.diem; }
        set { diem = value; }
    }
    public override string ToString()
    {
        return this.maSP + "; " + this.tieuDe + "; " + this.noiDung + "; " + this.nguoigoi + "; " + this.thoiGian + "; "+ this.trangThai+";"+ this.diem +";" ;
    }
    public override bool Equals(Object obj)
    {
        EDanhGia me = (EDanhGia)obj;
        bool ret = this.MaSP.Equals(me.MaSP);
        return ret;
    }
    public override int GetHashCode()
    {
        return  this.MaSP.GetHashCode();
    }

}